<div class="main-page">    
    <div class="game-info">
        <img src="<?php echo Yii::app()->createUrl('files/games/'.$model->image); ?>"/>
        <div class="game-info-details">
            <div class="game-info-item game-info-name"><?php echo $model->name ?></div> 
            <div class="game-info-item"><span>Version: </span><?php if(($model->getCurrentVersion($device))) echo $model->getCurrentVersion($device)->getCurrentVersion(); else echo "N/A"; ?></div>
            <div class="game-info-item"><span>Hỗ trợ: </span><?php if(($model->getCurrentVersion($device))) echo $model->getCurrentVersion($device)->description; else echo "N/A"?></div>
            <div class="game-info-item"><span>Dung lượng: </span><?php if(($model->getCurrentVersion($device))) echo $model->getCurrentVersion($device)->getSize(); else echo "N/A"?></div>
            <div class="game-info-item"><span>Số lượt tải: </span><?php  echo $model->countDownload;?></div>
        </div>
    </div>    
    
    <section class="group-download">
        <ul>
            <?php if($device == "ios"):?>
            <li><nav><a href="<?php if($model->getCurrentVersion('ios')) echo $model->getCurrentVersion('ios')->gamePlatform->market_url ?>" class="market-apple" id="download_market"><img src="<?php echo Yii::app()->createUrl('css/images/apple_down.png') ?>">Appstore</a></nav></li>            
            <?php elseif($device =="android"):?>
            <li><nav><a href="<?php if($model->getCurrentVersion('android')) echo $model->getCurrentVersion('android')->gamePlatform->market_url ?>" class="market-google" id="download_market"><img src="<?php echo Yii::app()->createUrl('css/images/android_down.png') ?>">Playstore</a></nav></li>            
            <?php else:?>
            <?php endif;?>
            <li><nav><a href="<?php echo Yii::app()->createUrl('site/download?game='.$model->code_identifier); ?>" class="not-market" id="download_not_market"><img src="<?php echo Yii::app()->createUrl('css/images/tai.png') ?>">Tải trực tiếp</a></nav></li>
        </ul>
    </section>
    
    <div class="game-description">
        <div class="social" style="padding-top: 10px;padding-bottom: 10px;">
            <div id="fb-root"></div>                
            <script>(function(d, s, id) {
              var js, fjs = d.getElementsByTagName(s)[0];
              if (d.getElementById(id)) return;
              js = d.createElement(s); js.id = id;
              js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=328563347242091";
              fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));</script>
            <div class="fb-like" style="margin: 0px 30px 0px 14px !important; width:50px !important; display: inline-block !important" data-href="<?php echo Yii::app()->createAbsoluteUrl('site/detail?id='.$model->id) ?>" data-width="50" data-layout="button_count" data-show-faces="false" data-send="false"></div>
            <div class="g-plusone" data-size="Medium" data-href="<?php echo Yii::app()->createAbsoluteUrl('site/detail?id='.$model->id) ?>"></div>
            <!-- Place this render call where appropriate -->
            <script type="text/javascript">
                (function() {
                   var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                   po.src = 'https://apis.google.com/js/plusone.js';
                   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
                })();
            </script>
        </div>
        <?php $content = str_replace('../../../../files/games/', '../files/games/', $model->description) ?>
        <?php echo $content; ?>        
    </div>
</div>

<div class="separator"><span>GAME KHÁC</span></div>

<div class="main-page">  
    <?php if(isset($modelGameDiff)): ?>
    <?php foreach($modelGameDiff as $index => $item):?>    
        <div class="row2 clearfix row2_1 r_1">
            <div class="left" align="center">
                <a href="<?php echo Yii::app()->createUrl('game/'.$item->game->slug); ?>">
                    <?php if($item->game->hot == 1):?>
                    <span class="ribbon ribbon_hot"></span>
                    <?php endif;?>    
                    <img src="<?php echo Yii::app()->createAbsoluteUrl('files/games/'.$item->game->image) ?>" class="icon">
                
                </a>
           </div>
           <div class="right right_1" align="right">
                <a href="<?php echo Yii::app()->createUrl('game/'.$item->game->slug); ?>"></a>
           </div>
           <div class="info">
                <a href="<?php echo Yii::app()->createUrl('game/'.$item->game->slug); ?>">
                    <div class="name"><?php echo $item->game->name ?></div>
                    <div class="mid_info"><?php echo $item->game->sapo ?></div>                    
                    <span class="button-detail"></span>
                </a>                 
                <div class="download-button">
                    <span class="bottom_info"><img src="<?php echo Yii::app()->createAbsoluteUrl('css/images/tai.png') ?>" style="margin-left: 15px;"><?php echo $item->game->countDownload  ?></span>
                    <a class="download_1 position1" href="<?php echo Yii::app()->createUrl('site/download?game='.$item->game->code_identifier); ?>"><span>Tải ngay</span></a>                
                </div>
           </div>           
        </div>    
    <?php endforeach; ?>
    <?php endif; ?>
</div>





